import { service } from "../http/index";

// 用户登录
export function login(data) {
  return service({
    method: "post",
    url: "/auth/login",
    data,
  });
}
// 用户注册

export function register(data) {
  return service({
    method: "post",
    url: "/auth/register",
    data,
  });
}
// 发送短信

export function sendSmsCode(data) {
  return service({
    method: "get",
    url: "/auth/sendSmsCode",
    params: data,
  });
}
//上传文件

export function getZdmemberUserByID(data) {
  return service({
    method: "get",
    url: "/api/zdmember/getZdmemberUserByID",
    params: data,
  });
}
//根据用户id获取当前用户信息
export function uploadFile(data) {
  const formData = new FormData();
  formData.append("file", data); // Assuming 'data' is the file you want to upload

  return service({
    method: "post",
    url: "/uploadFile",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}

//修改用户信息
export function userUpdate(data) {
  return service({
    method: "post",
    url: "/userUpdate",
    params: data,
  });
}

// 管理端功能

// 管理端个案详情

export function getDetail(data) {
  return service({
    method: "get",
    url: "/api/manager/getDetail",
    params: data,
  });
}
// 管理端个案列表

export function getManagerCaseList(data) {
  return service({
    method: "get",
    url: "/api/manager/getManagerCaseList/",
    params: data,
  });
}

// 分配个人训练

export function assignPractice(data) {
  return service({
    method: "post",
    url: "/api/teacher/assignPractice",
    params: data,
  });
}

// 个案列表
export function getTeacherCaseList(data) {
  return service({
    method: "post",
    url: "/api/teacher/getTeacherCaseList",
    params: data,
  });
}

// 危机咨询保存
export function save(data) {
  return service({
    method: "post",
    url: "/api/teacher/save",
    params: data,
  });
}
// 更新危机咨询
export function update(data) {
  return service({
    method: "post",
    url: "/api/teacher/update",
    params: data,
  });
}

// 危机个案干预详情
export function getDetailzixun(data) {
  return service({
    method: "get",
    url: "/api/teacher/getDetail/" + data.appointmentId,
    params: data,
  });
}

export function getPracticeList(data) {
  return service({
    method: "get",
    url: "/api/teacher/getPracticeList",
    params: data,
  });
}

// 员工端功能
// 员工端预约记录列表
export function getIntakeByMobile(data) {
  return service({
    method: "post",
    url: "/employee/getIntakeByMobile",
    params: data,
  });
}
// 员工端预约记录详情
export function getIntakeById(data) {
  return service({
    method: "get",
    url: "/employee/getIntakeById/{id}",
    params: data,
  });
}

// 民生登录
export function loginMobile(data) {
  return service({
    method: "get",
    url: "/employee/loginMobile",
    params: data,
  });
}

// /api/zdmember/updateUserById
export function updateUserById(data) {
  return service({
    method: "post",
    url: "/api/zdmember/updateUserById",
    data,
  });
}
